{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {
    "colab_type": "text",
    "id": "7765UFHoyGx6"
   },
   "source": [
    "##### Copyright 2019 The TensorFlow Authors."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 0,
   "metadata": {
    "cellView": "form",
    "colab": {},
    "colab_type": "code",
    "id": "KVtTDrUNyL7x"
   },
   "outputs": [],
   "source": [
    "#@title Licensed under the Apache License, Version 2.0 (the \"License\");\n",
    "# you may not use this file except in compliance with the License.\n",
    "# You may obtain a copy of the License at\n",
    "#\n",
    "# https://www.apache.org/licenses/LICENSE-2.0\n",
    "#\n",
    "# Unless required by applicable law or agreed to in writing, software\n",
    "# distributed under the License is distributed on an \"AS IS\" BASIS,\n",
    "# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n",
    "# See the License for the specific language governing permissions and\n",
    "# limitations under the License."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "colab_type": "text",
    "id": "xPYxZMrWyA0N"
   },
   "source": [
    "#How to train Boosted Trees models in TensorFlow 2.0"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "colab_type": "text",
    "id": "p_vOREjRx-Y0"
   },
   "source": [
    "<table class=\"tfo-notebook-buttons\" align=\"left\">\n",
    "  <td>\n",
    "    <a target=\"_blank\" href=\"https://www.tensorflow.org/alpha/tutorials/estimators/boosted_trees\"><img src=\"https://www.tensorflow.org/images/tf_logo_32px.png\" />View on TensorFlow.org</a>\n",
    "  </td>\n",
    "  <td>\n",
    "    <a target=\"_blank\" href=\"https://colab.sandbox.google.com/github/tensorflow/docs/blob/master/site/en/r2/tutorials/estimators/boosted_trees.ipynb\"><img src=\"https://www.tensorflow.org/images/colab_logo_32px.png\" />Run in Google Colab</a>\n",
    "  </td>\n",
    "  <td>\n",
    "    <a target=\"_blank\" href=\"https://github.com/tensorflow/docs/tree/master/site/en/r2/tutorials/estimators/boosted_trees.ipynb\"><img src=\"https://www.tensorflow.org/images/GitHub-Mark-32px.png\">View source on GitHub</a>\n",
    "  </td>\n",
    "</table>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "colab_type": "text",
    "id": "dW3r7qVxzqN5"
   },
   "source": [
    "This tutorial is an end-to-end walkthrough of training a Gradient Boosting  model using decision trees with the `tf.estimator` API. Boosted Trees models are among the most popular and effective machine learning approaches for both regression and classification. It is an ensemble technique that combines the predictions from several (think 10s, 100s or even 1000s) tree models.\n",
    "\n",
    "Boosted Trees models are popular with many machine learning practitioners as they can achieve impressive performance with minimal hyperparameter tuning."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "colab_type": "text",
    "id": "eylrTPAN3rJV"
   },
   "source": [
    "## Load the titanic dataset\n",
    "You will be using the titanic dataset, where the (rather morbid) goal is to predict passenger survival, given characteristics such as gender, age, class, etc."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 0,
   "metadata": {
    "colab": {},
    "colab_type": "code",
    "id": "KuhAiPfZ3rJW"
   },
   "outputs": [],
   "source": [
    "from __future__ import absolute_import, division, print_function\n",
    "\n",
    "import numpy as np\n",
    "import pandas as pd\n",
    "from IPython.display import clear_output\n",
    "\n",
    "# Load dataset.\n",
    "dftrain = pd.read_csv('https://storage.googleapis.com/tf-datasets/titanic/train.csv')\n",
    "dfeval = pd.read_csv('https://storage.googleapis.com/tf-datasets/titanic/eval.csv')\n",
    "y_train = dftrain.pop('survived')\n",
    "y_eval = dfeval.pop('survived')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 0,
   "metadata": {
    "colab": {},
    "colab_type": "code",
    "id": "NFtnFm1T0kMf"
   },
   "outputs": [],
   "source": [
    "!pip install tensorflow==2.0.0-alpha0\n",
    "import tensorflow as tf\n",
    "tf.random.set_seed(123)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "colab_type": "text",
    "id": "3ioodHdVJVdA"
   },
   "source": [
    "The dataset consists of a training set and an evaluation set:\n",
    "\n",
    "* `dftrain` and `y_train` are the *training set*—the data the model uses to learn.\n",
    "* The model is tested against the *eval set*, `dfeval`, and `y_eval`.\n",
    "\n",
    "For training you will use the following features:\n",
    "\n",
    "\n",
    "<table>\n",
    "  <tr>\n",
    "    <th>Feature Name</th>\n",
    "    <th>Description</th> \n",
    "  </tr>\n",
    "  <tr>\n",
    "    <td>sex</td>\n",
    "    <td>Gender of passenger</td> \n",
    "  </tr>\n",
    "  <tr>\n",
    "    <td>age</td>\n",
    "    <td>Age of passenger</td> \n",
    "  </tr>\n",
    "    <tr>\n",
    "    <td>n_siblings_spouses</td>\n",
    "    <td># siblings and partners aboard</td> \n",
    "  </tr>\n",
    "    <tr>\n",
    "    <td>parch</td>\n",
    "    <td># of parents and children aboard</td> \n",
    "  </tr>\n",
    "    <tr>\n",
    "    <td>fare</td>\n",
    "    <td>Fare passenger paid.</td> \n",
    "  </tr>\n",
    "    <tr>\n",
    "    <td>class</td>\n",
    "    <td>Passenger's class on ship</td> \n",
    "  </tr>\n",
    "    <tr>\n",
    "    <td>deck</td>\n",
    "    <td>Which deck passenger was on</td> \n",
    "  </tr>\n",
    "    <tr>\n",
    "    <td>embark_town</td>\n",
    "    <td>Which town passenger embarked from</td> \n",
    "  </tr>\n",
    "    <tr>\n",
    "    <td>alone</td>\n",
    "    <td>If passenger was alone</td> \n",
    "  </tr>\n",
    "</table>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "colab_type": "text",
    "id": "AoPiWsJALr-k"
   },
   "source": [
    "## Explore the data"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "colab_type": "text",
    "id": "slcat1yzmzw5"
   },
   "source": [
    "Let's first preview some of the data and create summary statistics on the training set."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 0,
   "metadata": {
    "colab": {
     "height": 197
    },
    "colab_type": "code",
    "id": "15PLelXBlxEW",
    "outputId": "a70017c0-7011-4663-a9a5-0d4df931d854"
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div style=\"max-width:1500px;overflow:auto;\">\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>sex</th>\n",
       "      <th>age</th>\n",
       "      <th>n_siblings_spouses</th>\n",
       "      <th>parch</th>\n",
       "      <th>fare</th>\n",
       "      <th>class</th>\n",
       "      <th>deck</th>\n",
       "      <th>embark_town</th>\n",
       "      <th>alone</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>male</td>\n",
       "      <td>22.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>7.2500</td>\n",
       "      <td>Third</td>\n",
       "      <td>unknown</td>\n",
       "      <td>Southampton</td>\n",
       "      <td>n</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>female</td>\n",
       "      <td>38.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>71.2833</td>\n",
       "      <td>First</td>\n",
       "      <td>C</td>\n",
       "      <td>Cherbourg</td>\n",
       "      <td>n</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>female</td>\n",
       "      <td>26.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>7.9250</td>\n",
       "      <td>Third</td>\n",
       "      <td>unknown</td>\n",
       "      <td>Southampton</td>\n",
       "      <td>y</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>female</td>\n",
       "      <td>35.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>53.1000</td>\n",
       "      <td>First</td>\n",
       "      <td>C</td>\n",
       "      <td>Southampton</td>\n",
       "      <td>n</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>male</td>\n",
       "      <td>28.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>8.4583</td>\n",
       "      <td>Third</td>\n",
       "      <td>unknown</td>\n",
       "      <td>Queenstown</td>\n",
       "      <td>y</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "      sex   age  n_siblings_spouses  parch     fare  class     deck  \\\n",
       "0    male  22.0                   1      0   7.2500  Third  unknown   \n",
       "1  female  38.0                   1      0  71.2833  First        C   \n",
       "2  female  26.0                   0      0   7.9250  Third  unknown   \n",
       "3  female  35.0                   1      0  53.1000  First        C   \n",
       "4    male  28.0                   0      0   8.4583  Third  unknown   \n",
       "\n",
       "   embark_town alone  \n",
       "0  Southampton     n  \n",
       "1    Cherbourg     n  \n",
       "2  Southampton     y  \n",
       "3  Southampton     n  \n",
       "4   Queenstown     y  "
      ]
     },
     "execution_count": 0,
     "metadata": {
      "tags": []
     },
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dftrain.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 0,
   "metadata": {
    "colab": {
     "height": 287
    },
    "colab_type": "code",
    "id": "j2hiM4ETmqP0",
    "outputId": "06e07faa-5fbc-41d8-b450-1d93b6995359"
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div style=\"max-width:1500px;overflow:auto;\">\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>age</th>\n",
       "      <th>n_siblings_spouses</th>\n",
       "      <th>parch</th>\n",
       "      <th>fare</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>count</th>\n",
       "      <td>627.000000</td>\n",
       "      <td>627.000000</td>\n",
       "      <td>627.000000</td>\n",
       "      <td>627.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>mean</th>\n",
       "      <td>29.631308</td>\n",
       "      <td>0.545455</td>\n",
       "      <td>0.379585</td>\n",
       "      <td>34.385399</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>std</th>\n",
       "      <td>12.511818</td>\n",
       "      <td>1.151090</td>\n",
       "      <td>0.792999</td>\n",
       "      <td>54.597730</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>min</th>\n",
       "      <td>0.750000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25%</th>\n",
       "      <td>23.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>7.895800</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>50%</th>\n",
       "      <td>28.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>15.045800</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>75%</th>\n",
       "      <td>35.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>31.387500</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>max</th>\n",
       "      <td>80.000000</td>\n",
       "      <td>8.000000</td>\n",
       "      <td>5.000000</td>\n",
       "      <td>512.329200</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "              age  n_siblings_spouses       parch        fare\n",
       "count  627.000000          627.000000  627.000000  627.000000\n",
       "mean    29.631308            0.545455    0.379585   34.385399\n",
       "std     12.511818            1.151090    0.792999   54.597730\n",
       "min      0.750000            0.000000    0.000000    0.000000\n",
       "25%     23.000000            0.000000    0.000000    7.895800\n",
       "50%     28.000000            0.000000    0.000000   15.045800\n",
       "75%     35.000000            1.000000    0.000000   31.387500\n",
       "max     80.000000            8.000000    5.000000  512.329200"
      ]
     },
     "execution_count": 0,
     "metadata": {
      "tags": []
     },
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dftrain.describe()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "colab_type": "text",
    "id": "-IR0e8V-LyJ4"
   },
   "source": [
    "There are 627 and 264 examples in the training and evaluation sets, respectively."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 0,
   "metadata": {
    "colab": {
     "height": 34
    },
    "colab_type": "code",
    "id": "_1NwYqGwDjFf",
    "outputId": "4e0f44ab-dfa4-4976-9168-37beb321ef58"
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(627, 264)"
      ]
     },
     "execution_count": 0,
     "metadata": {
      "tags": []
     },
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dftrain.shape[0], dfeval.shape[0]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "colab_type": "text",
    "id": "28UFJ4KSMK3V"
   },
   "source": [
    "The majority of passengers are in their 20's and 30's."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 0,
   "metadata": {
    "colab": {
     "height": 278
    },
    "colab_type": "code",
    "id": "CaVDmZtuDfux",
    "outputId": "a99cdd41-3510-4c3e-8bef-934c277329fe"
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYMAAAEGCAYAAACHGfl5AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAFddJREFUeJzt3W1sU+fBxvHLcRKHEQxOljqpw4agH8KLphCCmMQeaU2E\n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qipVVlbq3r17\nCd9+A/n444/10ksvJTpGv8LhsPbu3atf/OIXamlp0e7du/XDH/5Q9+7dG9X6bFUGeXl5unbtWvQb\nIxKJ6Pr168rNzU1wsv7ZOW99fb0uX76sn//855IeZG1vb48u7+zslMPhSOhfso968cUXderUKVtt\n09OnT+vSpUsqLS1VSUmJrl27ptdff12XL1+23bb0er2SpLS0NK1atUpnz57Vs88+a6uczz77rFJT\nU/Xtb39bkvS1r31NWVlZcrlcun79ui32+aOuX7+uM2fOaNmyZZLs9/N+4cIF3bhxQ4WFhZIe3Pp/\nwoQJcrlco8ppqzLIyspSQUGB/H6/JMnv92vWrFkJP1R83MONbNe8O3fu1Pnz57Vr1y6lpj44Ezhn\nzhz19PRE73F+4MABLVmyJGEZ7927F/Opdy0tLZoyZYqysrI0c+ZMW2zTN954Q3/84x/1ySefqKWl\nRV6vV7/61a/02muv2Wpbdnd3686dO9Gvjx49qlmzZmn27Nm2yunxeLRgwYLoacFLly4pGAxq+vTp\ntvw5+vjjj/XNb35TkydPlmS/n/fc3Fx1dHTo0qVLkqR//vOfCgaDmjZt2qhy2u4dyP/617+0ceNG\nhUKh6G2vp02bluhY2rp1q06ePKlgMKgpU6bI4/HI7/fbLu/Fixe1bNkyTZs2Lfp29KlTp6qxsVFn\nz57Vpk2b1Nvbq/z8/IReZhgMBrV27Vp1d3crJSVFU6ZM0Y9//GPNnDnTdtv0odLSUu3Zsyd6aWlN\nTY0ttuWVK1e0bt06RSIRRSIRzZgxQ9XV1fryl79sq5wPs77zzjvq6upSWlqa3nrrLX3jG9+w5T5f\nvHixampqtHDhwuiY3XIeOXJEe/bskdPplCStW7dOJSUlo8ppuzIAADx5tjpNBABIDMoAAEAZAAAo\nAwCAKAMAgCgDAIAoAwCAKAMAgKT/Az96X9CTJZCZAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x7fa9f2235750>"
      ]
     },
     "metadata": {
      "tags": []
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "dftrain.age.hist(bins=20);"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "colab_type": "text",
    "id": "1pifWiCoMbR5"
   },
   "source": [
    "There are approximately twice as male passengers as female passengers aboard."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 0,
   "metadata": {
    "colab": {
     "height": 273
    },
    "colab_type": "code",
    "id": "-WazAq30MO5J",
    "outputId": "34b0b8b7-4c04-4fa9-b684-ed7774859828"
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAZcAAAEBCAYAAAC0WehTAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAEphJREFUeJzt3HtsU/X/x/FXW+Ykm+Uy5xggIWh0gCaCGmMUjEPDxcsA\ngXATTYbkq3KRS1QEEZAEB3y9sSBGvBBBkaAoC/GG04hKNAgYFImi4nQOnIPRbey7ufX8/jDrz7Ju\nK+7dnlqej4SEc3Z6Pq9+9llfO4dSj+M4jgAAMOR1O0AsBQIBrV69WoFAwO0oIWSKDpmil4i5yBSd\nZM6U9OVSWFiYcN84MrWNTNFLxFxkik4yZ0rqcgEAuINyAQCYo1wAAOaSvlwGDhwon8/ndowQn8+n\nHj16kKkNZIpeIuYiU3QSNdPAgQPbfR5PMr8Vubq6Wunp6W7HAIB/nfa+fiZ1uTQ5frxGwWDiPM2M\njHRVVFS7HSMMmaKTiJmkxMxFpugkWiav16MuXdLafZ4OBlkSXjDoJFS5SEq4PBKZopWImaTEzEWm\n6CRipvZK+n9zAQDEH+UCADBHuQAAzFEuAABzlAsAwBzlAgAwR7kAAMxRLgAAc5QLAMAc5QIAMEe5\nAADMUS4AAHOUCwDAHOUCADBHuQAAzFEuAABzlAsAwBzlAgAwR7kAAMxRLgAAc5QLAMAc5QIAMEe5\nAADMUS4AAHOUCwDAXAe3A8RDRka62xGaycw8x+0IzZApOqebqaG+TsdP1McoDZCYzohyKSn8jxpO\nlLsdA2eoPgtel0S54Mz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0/vvv6+Kigp17txZXbp0UVFRUatzFOv5i5TpmWee0YwZMyLO\nl6SYz9mhQ4d0yy23qHfv3qGPvTj//PO1evVq7d27V4sWLYo4dixznZrJ4/GoZ8+eys/P16JFi+T1\netXQ0KABAwbooYceUseOHSX99eK6YsUKOY6jvn376rHHHtPZZ59tkqmiokL33HOPamtr5fV61blz\nZz3wwAPq27eva2sqUqYHH3xQaWlpLf4MSrFfU383ZMgQPfvss7rwwgtbHTeemf6eq7q62nRNJW25\nAADck5S3xQAA7qJcAADmKBcAgDnKBQBgjnIBAJijXAAA5igXAIA5ygUAYO7/APiVwTDDlqDxAAAA\nAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x7fa9f22f4050>"
      ]
     },
     "metadata": {
      "tags": []
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "dftrain.sex.value_counts().plot(kind='barh');"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "colab_type": "text",
    "id": "7_XkxrpmmVU_"
   },
   "source": [
    "The majority of passengers were in the \"third\" class."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 0,
   "metadata": {
    "colab": {
     "height": 273
    },
    "colab_type": "code",
    "id": "zZ3PvVy4l4gI",
    "outputId": "7169146d-4267-4017-9d7f-674e4c8663b4"
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAZoAAAEBCAYAAABBp2PjAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAFHNJREFUeJzt3WtwVPX9x/HP7pKLJCQkEdMYg4LRJggVcNrYire0zqCC\nmoHWSlp4YJ1pC2FKZRAhoKT8K0msOMNCmKl9wFikZVKgBofRMpE603ZIR8xURzvTjMXQkEiaC5sA\n5rJ7/g8YUgObCyTfnN3k/Xq0e3bP2c+e3yEfztmd/Xkcx3EEAIARr9sBxkIgENCOHTsUCATcjnJN\nyO+eaM4ukd9t5L9owhSN3++P6sEmvzuiObtE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fSmITLX1FRoaKiorBjICmixqGurk6LFy/W\nLbfc0vf13qysLO3YsUMffPCBNm/eHDZnpLyHy/N7PB7ddNNNevrpp7V582Z5vV719vZq3rx52rBh\ng6677jpJF/8olpWVyXEc5ebmatu2bYqPjx/T7C0tLfrpT3+qCxcuyOv1aurUqXruueeUm5sbFcd/\nuPzr169XQkLCgH+DpGs7dsZ90QAA3DWuL50BANxH0QAATFE0AABTFA0AwBRFAwAwRdEAAExRNAAA\nUxQNAMDU/wPEj1OadhULvQAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x7fa9edb51990>"
      ]
     },
     "metadata": {
      "tags": []
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "dftrain['class'].value_counts().plot(kind='barh');"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "colab_type": "text",
    "id": "HM5SlwlxmZMT"
   },
   "source": [
    "Most passengers embarked from Southampton."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 0,
   "metadata": {
    "colab": {
     "height": 273
    },
    "colab_type": "code",
    "id": "RVTSrdr4mZaC",
    "outputId": "9ca0ecb9-d1f8-415a-f9ff-1f307818f989"
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAbwAAAEBCAYAAAAD5BB0AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XtUVPUC9vHvzKBkAl7IiMArZmhaYnYUW3qM8uSlVDy2\nXhO7Wq0u4FGzvGCmZCZa2RGy145WahczE1PLOhV57CTKKjOzK3YyUsAIRS4qt9nvH77MEbmNCsx0\nfs9nLVfMntl7P/z4NQ97D7PHZlmWhYiIyP84u6cDmKSgoICkpCQKCgo8HcVFmdzjjZnAO3Mpk3uU\nyX0NlUuF14QKCgpITk72qsmkTO7xxkzgnbmUyT3K5L6GyqXCExERI6jwRETECCo8ERExggqvifXp\n0weHw+HpGC4Oh4OQkBBlqoc3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6aW2+9td5tN+V8qilXpYaeUyq8JhAcHMzhw4ddE8XpdPLbb79xySWX\nNHmWoKAgAJo1a8b48eP58ssvufTSSzl06JDrMUeOHMFmszXZ0R3UPUaeHL+axqsyb1ONWWJiIpmZ\nmTz33HP17rupcp2ZCf47Vi1btuSWW25xXez3zExZWVkEBwc3aJ7TjRw5kl27dnndnKrMdezYMY/M\nq/T0dH7++Weuv/56oqKiOHz4MPfccw+ZmZkenU815Zo4cSI7duxo8DmlwmsCbdu2JTw8nM2bNwOw\nefNmevTo0eSnM0+cOEFRUZHr9rvvvkuPHj244oorKCkpcU2mtWvXMmzYsCbJVPmEU9cYeWr8ahqv\n7t27A9CzZ88mGbMlS5bw7bffsmzZMnx8fOrdd1PkqilTQUGB66/kysvL+eCDD1xjNXDgQPbt2+f6\nK8i1a9cydOjQBstz/PjxKqezUlNTad26NW3btqV79+4em1O15fL19fXIvLrvvvvYvn07H3/8Mamp\nqQQFBfHSSy8xceJEj86n2nL16tWrweeUrrTSRP7zn/8wY8YMCgoKaNWqFYmJiXTq1KlJM/z6669M\nmjQJp9OJ0+kkLCyM2bNnc9FFF7Fnzx4ee+wxSktLCQ0NZfHixbRt27ZRcsyfP58PP/yQvLw8Wrdu\nTZs2bdi8eXOdY9TY41dTphdeeIG4uLgaxwto9DHbv38/N998M506dXJdTql9+/YkJSXx5ZdfMmfO\nnBr33Zi5zsxks9kIDQ1l4sSJzJkzB7vdTnl5OREREcyaNYsWLVoAp57sFy1ahGVZdO/enYULF3LB\nBRc0SKa8vDwefPBBTpw4gd1up3Xr1kyfPp3u3bt7dE7VlGvGjBm0bNmy1v8PofHnVaXrr7+e5cuX\n07Vr1zpTJ1jwAAAASElEQVT32ZTPDafnKioqavA5pcITEREj6JSmiIgYQYUnIiJGUOGJiIgRVHgi\nImIEFZ6IiBhBhSciIkZQ4YmIiBFUeCIiYoT/BzpywSn2P7A9AAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x7fa9ed5ce610>"
      ]
     },
     "metadata": {
      "tags": []
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "dftrain['embark_town'].value_counts().plot(kind='barh');"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "colab_type": "text",
    "id": "aTn1niLPob3x"
   },
   "source": [
    "Females have a much higher chance of surviving vs. males. This will clearly be a predictive feature for the model."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 0,
   "metadata": {
    "colab": {
     "height": 292
    },
    "colab_type": "code",
    "id": "Eh3KW5oYkaNS",
    "outputId": "ab3bc5f7-7f0d-4627-e95c-d76ec909f175"
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAagAAAETCAYAAABjv5J2AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAGStJREFUeJzt3XtQlXXix/HP4YiOC7ImS4q3LcvEXJskzWxVXJC8cfM6\nWqYW6v5yTVvdzdE2r7mmVpYyXtpaZdFmF00Hwcuq4H3Q8tKqG66psaSS4pWLBhx4fn+4MhEYxzhw\nvsj7NdOMnMtzPqDDu/OI59gsy7IEAIBhPNw9oCbIzs7WkiVLlJ2d7e4pd1UTNkrsdDV2uhY7XccV\nGwmUE7KzsxUTE2P8HwbTN0rsdDV2uhY7XccVGwkUAMBIBAoAYCQCBQAwEoFyUmBgoOx2u7tn3JXd\nblezZs2M3iix09XY6VrsdB273a7AwMBKHcPGj5lXLDc3V97e3u6eAQA1TmW+fxKoe3DtWp6Ki839\ncvn6euvKlVx3z6gQO12Lna7FTtfw8LDpgQe8KnWMOi7aUisUF1tGB0qS8fvuYKdrsdO12GkG/g4K\nAGAkAgUAMBKBAgAYiUABAIxEoAAARiJQAAAjESgAgJEIFADASAQKAGAkAgUAMBKBAgAYiUABAIxE\noAAARiJQAAAjESgAgJEIFADASAQKAGAkAgUAMBKBAgAYiUABAIxEoAAARiJQAAAjESgAgJEIFADA\nSAQKAGCkOu4eUJP4+nq7e0KF/PwauHuCHAX5unajwN0zANRwBOoeZMT8nxw3stw9w3it3vhUEoEC\nUDmc4gMAGIlAAQCMRKAAAEYiUAAAIxEoAICRCBQAwEgECgBgJAIFADASgQIAGIlAAQCMRKAAAEYi\nUAAAIxEoAICRCBQAwEgECgBgJAIFADASgQIAGIlAAQCMRKAAAEYiUAAAIxEoAICR7ttAxcTEaMGC\nBe6eAQD4ie7bQAEAarY67h5QnoCAAL322mvasWOHbty4odmzZys1NVV79+6Vw+HQBx98oFatWuny\n5cuaNGmS8vLyVFBQoKCgIP3hD38o95gfffSRtm3bJofDocaNG+utt96Sr69vNX9mAABnGfsM6uc/\n/7nWrVunyZMna9y4cerYsaM2bNigyMhILV++XJLk4+OjFStW6NNPP9WGDRt0/Phx7du3r8yxNm7c\nqIyMDMXHx2v9+vXq3r275s2bV+7jZmdn69y5c6X+y8zMrNLPFQDuV5mZmWW+p2ZnZzt1XyOfQUlS\nnz59JEnt2rWTh4eHunfvXvLxjh07JElFRUWaP3++jh49KsuydOXKFaWlpalr166ljpWSkqJ///vf\nioqKKrmfj49PuY8bGxurmJiYUpc1a9ZMKSkpLv387nd+fg0qdb0p2Ola7HStmrDzhRde0Pnz50td\nNn78eL366qsV3tfIQNlsNtWrV0+S5OHhobp165ZcZ7fb5XA4JEkrV65UTk6O1q1bJ09PT02fPl35\n+flljmdZll555RUNGDCgwsceOXKk+vfvX+oyu91emU+nVsrKyrnrdX5+DX70elOw07XY6Vqm7/Tw\nsMnX11tr1qxRUVFRqevu9gThh4wMlGVZP/rxHTk5OfLz85Onp6cuXryo5ORkDRs2rMztgoODFRcX\np549e8rHx0cFBQU6e/asAgICytzWx8fH6S8eAODH+fv7/+T7Ghkom832ox/f8eKLL2rixIkaMGCA\nmjRpoi5dupR7u8jISF2/fl3Dhw+XzWZTcXGxnn/++XIDBQAwg82629MTlJER839y3Mhy9wzjtXrj\nU07xVSN2uhY7XePOKb5KHcNFWwAAcCkCBQAwEoECABiJQAEAjESgAABGIlAAACM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r1dffbXCY7slUJIUEBCguLi4MpefP39edevWLfnYbrerXr16pT52OBySpPfee09+fn5asGCBbDab\noqOjVVBQUOaYlmVpxowZ6ty5c4W7Ro4cqf79+5e6zG63O/15AUBtkpWVU+7lHh42+fp6a82aNeU+\ng3KGW37MvEOHDkpPT9fBgwdLLjt+/HjJr+88q6pITk6O/P39ZbPZdOrUKR06dKjc2wUHB2vlypXK\nz8+XJOXl5enMmTPl3tbHx0fNmzcv9R+n9wDgp/H39y/zPdXZQFXrMyibzSbpdgSWLVum+fPna968\neSooKFDLli21fPnyUreryCuvvKLXX39dGzduVMuWLdWpU6dybzd27FgtWbJEgwYNks1mk4eHh8aP\nH69HHnnENZ8YAMDlbJazT1eg6Le26dK1W+6eAQBGSHw3ssJTfJXBK0kAAIxEoAAARiJQAAAjESgA\ngJEIFADASAQKAGAkAgUAMBKBAgAYiUABAIxEoAAARiJQAAAjESgAgJEIFADASAQKAGAkAgUAMBKB\nAgAYiUABAIxEoAAARiJQAAAjESgAgJEIFADASAQKAGAkAgUAMJLNsizL3SMAADXPd/kO5WTfKvc6\nDw+bfH29K3X8OpW6dy1z5UquiovN7bmfXwNlZeW4e0aF2Ola7HQtdpqDU3wAACMRKACAkQgUAMBI\nBAoAYCQCBQAwEoECABiJQAEAjESgAABGIlAAACMRKACAkQgUAMBIBAoAYCQCBQAwEoECABiJQAEA\njESgAABGIlAAACMRKACAkQgUAMBIBAoAYCQCBQAwEoECABiJQAEAjESgAABGIlAAACPVcfeAmsTD\nw+buCRWqCRsldroaO12LnZXnim02y7IsF2y5r+Xm5srb29vdMwCgxqnM909O8Tnh+vXrGjZsmDIz\nM9095a4yMzMVHBxs9EaJna7GTtdip+tkZmZq2LBhun79+k8+BoFy0pEjR1RUVOTuGXdVVFSk8+fP\nG71RYqersdO12Ok6RUVFOnLkSKWOQaAAAEYiUAAAIxEoAICR7DNnzpzp7hE1Qb169dS5c2fVq1fP\n3VPuqiZslNjpaux0LXa6TmU38mPmAAAjcYoPAGA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bpeXl1fJu84GBATo9OnTOnnypAoKChQTE+PU27qHhYUp\nLi5Ohw8fVu/eve96u+7du+vChQtavHhxqb8r69Gjh77++mslJCTI4XCosLBQx48f5++gUG0IFOBi\nBw8eVG5urkJCQiRJTzzxhIKCgtSjRw99/vnnGjNmTLn3S0hIUEhIiDp27Kj4+HgtXLhQkvTQQw/p\nd7/7nUaNGqVevXqpY8eOTu3o16+fPv/8cz3zzDNq2LDhXW9Xt25dhYaGKjU1tdQzLS8vL/31r3/V\n5s2b1a1bN3Xr1k3vvvuuCgsLnf1SAJXCP9QFABiJZ1AAACMRKACAkQgUAMBIBAoAYCQCBQAwEoEC\nABiJQAEAjESgAABGIlAAACP9P3VWSOSP5ZgBAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x7fa9ed0c2410>"
      ]
     },
     "metadata": {
      "tags": []
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "pd.concat([dftrain, y_train], axis=1).groupby('sex').survived.mean().plot(kind='barh').set_xlabel('% survive');"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "colab_type": "text",
    "id": "krkRHuMp3rJn"
   },
   "source": [
    "## Create feature columns and input functions\n",
    "The Gradient Boosting estimator can utilize both numeric and categorical features. Feature columns work with all TensorFlow estimators and their purpose is to define the features used for modeling. Additionally they provide some feature engineering capabilities like one-hot-encoding, normalization, and bucketization. In this tutorial, the fields in `CATEGORICAL_COLUMNS` are transformed from categorical columns to one-hot-encoded columns ([indicator column](https://www.tensorflow.org/api_docs/python/tf/feature_column/indicator_column)):"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 0,
   "metadata": {
    "colab": {},
    "colab_type": "code",
    "id": "upaNWxcF3rJn"
   },
   "outputs": [],
   "source": [
    "fc = tf.feature_column\n",
    "CATEGORICAL_COLUMNS = ['sex', 'n_siblings_spouses', 'parch', 'class', 'deck', \n",
    "                       'embark_town', 'alone']\n",
    "NUMERIC_COLUMNS = ['age', 'fare']\n",
    "  \n",
    "def one_hot_cat_column(feature_name, vocab):\n",
    "  return tf.feature_column.indicator_column(\n",
    "      tf.feature_column.categorical_column_with_vocabulary_list(feature_name,\n",
    "                                                 vocab))\n",
    "feature_columns = []\n",
    "for feature_name in CATEGORICAL_COLUMNS:\n",
    "  # Need to one-hot encode categorical features.\n",
    "  vocabulary = dftrain[feature_name].unique()\n",
    "  feature_columns.append(one_hot_cat_column(feature_name, vocabulary))\n",
    "  \n",
    "for feature_name in NUMERIC_COLUMNS:\n",
    "  feature_columns.append(tf.feature_column.numeric_column(feature_name,\n",
    "                                           dtype=tf.float32))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "colab_type": "text",
    "id": "74GNtFpStSAz"
   },
   "source": [
    "You can view the transformation that a feature column produces. For example, here is the output when using the `indicator_column` on a single example:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 0,
   "metadata": {
    "colab": {
     "height": 52
    },
    "colab_type": "code",
    "id": "Eaq79D9FtmF8",
    "outputId": "5b55b1e9-3c24-457a-9dd7-df6ea0831e60"
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Feature value: \"Third\"\n",
      "One-hot encoded:  [[ 0.  0.  1.]]\n"
     ]
    }
   ],
   "source": [
    "example = dict(dftrain.head(1))\n",
    "class_fc = tf.feature_column.indicator_column(tf.feature_column.categorical_column_with_vocabulary_list('class', ('First', 'Second', 'Third')))\n",
    "print('Feature value: \"{}\"'.format(example['class'].iloc[0]))\n",
    "print('One-hot encoded: ', tf.keras.layers.DenseFeatures([class_fc])(example).numpy())"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "colab_type": "text",
    "id": "YbCUn3nCusC3"
   },
   "source": [
    "Additionally, you can view all of the feature column transformations together:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 0,
   "metadata": {
    "colab": {
     "height": 105
    },
    "colab_type": "code",
    "id": "omIYcsVws3g0",
    "outputId": "ab554118-2e13-4439-a6e8-b1658d51d99e"
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 22.  ,   1.  ,   0.  ,   1.  ,   0.  ,   0.  ,   1.  ,   0.  ,\n",
       "          0.  ,   0.  ,   0.  ,   0.  ,   0.  ,   0.  ,   1.  ,   0.  ,\n",
       "          0.  ,   0.  ,   7.25,   1.  ,   0.  ,   0.  ,   0.  ,   0.  ,\n",
       "          0.  ,   0.  ,   1.  ,   0.  ,   0.  ,   0.  ,   0.  ,   0.  ,\n",
       "          1.  ,   0.  ]], dtype=float32)"
      ]
     },
     "execution_count": 0,
     "metadata": {
      "tags": []
     },
     "output_type": "execute_result"
    }
   ],
   "source": [
    "tf.keras.layers.DenseFeatures(feature_columns)(example).numpy()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "colab_type": "text",
    "id": "-UOlROp33rJo"
   },
   "source": [
    "Next you need to create the input functions. These will specify how data will be read into our model for both training and inference. You will use the `from_tensor_slices` method in the [`tf.data`](https://www.tensorflow.org/api_docs/python/tf/data) API to read in data directly from Pandas. This is suitable for smaller, in-memory datasets. For larger datasets, the tf.data API supports a variety of file formats (including [csv](https://www.tensorflow.org/api_docs/python/tf/data/experimental/make_csv_dataset)) so that you can process datasets that do not fit in memory."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 0,
   "metadata": {
    "colab": {},
    "colab_type": "code",
    "id": "9dquwCQB3rJp"
   },
   "outputs": [],
   "source": [
    "# Use entire batch since this is such a small dataset.\n",
    "NUM_EXAMPLES = len(y_train)\n",
    "\n",
    "def make_input_fn(X, y, n_epochs=None, shuffle=True):\n",
    "  def input_fn():\n",
    "    dataset = tf.data.Dataset.from_tensor_slices((dict(X), y))\n",
    "    if shuffle:\n",
    "      dataset = dataset.shuffle(NUM_EXAMPLES)\n",
    "    # For training, cycle thru dataset as many times as need (n_epochs=None).    \n",
    "    dataset = dataset.repeat(n_epochs)\n",
    "    # In memory training doesn't use batching.\n",
    "    dataset = dataset.batch(NUM_EXAMPLES)\n",
    "    return dataset\n",
    "  return input_fn\n",
    "\n",
    "# Training and evaluation input functions.\n",
    "train_input_fn = make_input_fn(dftrain, y_train)\n",
    "eval_input_fn = make_input_fn(dfeval, y_eval, shuffle=False, n_epochs=1)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "colab_type": "text",
    "id": "HttfNNlN3rJr"
   },
   "source": [
    "## Train and evaluate the model\n",
    "\n",
    "Below you will do the following steps:\n",
    "\n",
    "1. Initialize the model, specifying the features and hyperparameters. \n",
    "2. Feed the training data to the model using the `train_input_fn` and train the model using the `train` function.\n",
    "3. You will assess model performance using the evaluation set—in this example, the `dfeval` DataFrame. You will verify that the predictions match the labels from the `y_eval` array.\n",
    "\n",
    "Before training a Boosted Trees model, let's first train a linear classifier (logistic regression model). It is best practice to start with simpler model to establish a benchmark."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 0,
   "metadata": {
    "colab": {
     "height": 230
    },
    "colab_type": "code",
    "id": "JPOGpmmq3rJr",
    "outputId": "6377ff81-2b15-4c05-ddef-f91a89e7d934"
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "accuracy                  0.765152\n",
      "accuracy_baseline         0.625000\n",
      "auc                       0.832844\n",
      "auc_precision_recall      0.789631\n",
      "average_loss              0.478908\n",
      "global_step             100.000000\n",
      "label/mean                0.375000\n",
      "loss                      0.478908\n",
      "precision                 0.703297\n",
      "prediction/mean           0.350790\n",
      "recall                    0.646465\n",
      "dtype: float64\n"
     ]
    }
   ],
   "source": [
    "linear_est = tf.estimator.LinearClassifier(feature_columns)\n",
    "\n",
    "# Train model.\n",
    "linear_est.train(train_input_fn, max_steps=100)\n",
    "\n",
    "# Evaluation.\n",
    "result = linear_est.evaluate(eval_input_fn)\n",
    "clear_output()\n",
    "print(pd.Series(result))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "colab_type": "text",
    "id": "BarkNXwA3rJu"
   },
   "source": [
    "Next let's train a Boosted Trees model. For boosted trees, regression (`BoostedTreesRegressor`) and classification (`BoostedTreesClassifier`) are supported. Since the goal is to predict a class - survive or not survive, you will use the `BoostedTreesClassifier`.\n",
    "\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 0,
   "metadata": {
    "colab": {
     "height": 230
    },
    "colab_type": "code",
    "id": "tgEzMtlw3rJu",
    "outputId": "14e06ea5-563a-447d-f8e0-5fa04743da07"
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "accuracy                  0.829545\n",
      "accuracy_baseline         0.625000\n",
      "auc                       0.872788\n",
      "auc_precision_recall      0.857807\n",
      "average_loss              0.411839\n",
      "global_step             100.000000\n",
      "label/mean                0.375000\n",
      "loss                      0.411839\n",
      "precision                 0.793478\n",
      "prediction/mean           0.381942\n",
      "recall                    0.737374\n",
      "dtype: float64\n"
     ]
    }
   ],
   "source": [
    "# Since data fits into memory, use entire dataset per layer. It will be faster.\n",
    "# Above one batch is defined as the entire dataset. \n",
    "n_batches = 1\n",
    "est = tf.estimator.BoostedTreesClassifier(feature_columns,\n",
    "                                          n_batches_per_layer=n_batches)\n",
    "\n",
    "# The model will stop training once the specified number of trees is built, not \n",
    "# based on the number of steps.\n",
    "est.train(train_input_fn, max_steps=100)\n",
    "\n",
    "# Eval.\n",
    "result = est.evaluate(eval_input_fn)\n",
    "clear_output()\n",
    "print(pd.Series(result))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "colab_type": "text",
    "id": "hEflwznXvuMP"
   },
   "source": [
    "Now you can use the train model to make predictions on a passenger from the evaluation set. TensorFlow models are optimized to make predictions on a batch, or collection, of examples at once. Earlier,  the `eval_input_fn` is  defined using the entire evaluation set."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 0,
   "metadata": {
    "colab": {
     "height": 288
    },
    "colab_type": "code",
    "id": "6zmIjTr73rJ4",
    "outputId": "50efec14-6bcc-450a-cc04-02d3ff4a13b7"
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVB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1aXL58WQgh\nxNSpU8UPP/wghLh9RU18fLzo16+f6N+/v9i5c6cjS7YbKb0YNWqUCA8PFyNGjBDDhw8XI0aMED/9\n9JMjy7YLKb24U3JycqO92kpKL0wmk1ixYoUYPHiwiIiIEG+//bYjS7YbKb3Izs4WkyZNEkOHDhVD\nhgwRS5cuFUaj0ZFl28XSpUtFz549xRNPPCG6d+8uIiIihBDWf3fy8SRERCRbg5i2IiIi58LwICIi\n2RgeREQkG8ODiIhkY3gQEZFsDA8iIpKN4UFERLIxPIiISLb/A+ehpDT73FBfAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x7fa5627d2b10>"
      ]
     },
     "metadata": {
      "tags": []
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "pred_dicts = list(est.predict(eval_input_fn))\n",
    "probs = pd.Series([pred['probabilities'][1] for pred in pred_dicts])\n",
    "\n",
    "probs.plot(kind='hist', bins=20, title='predicted probabilities');"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "colab_type": "text",
    "id": "mBUaNN1BzJHG"
   },
   "source": [
    "Finally you can also look at the receiver operating characteristic (ROC) of the results, which will give us a better idea of the tradeoff between the true positive rate and false positive rate."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 0,
   "metadata": {
    "colab": {
     "height": 306
    },
    "colab_type": "code",
    "id": "NzxghvVz3rJ6",
    "outputId": "1a702db3-8c34-4e3d-cae9-1d0639e45ba7"
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAZMAAAEiCAYAAAA8ij+xAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xlc1HX+B/DXzCAIAnIIOOCRdohHHngveCEKCopaXkVh\npqSp66b91DSF1dXSrTVXwrRcw2zdtDTF1NV0KzMSTVdtEzWPQG45HAE5Zubz+4OYaeLwC8PMMPB6\nPh4+iu98Z+Y974fOi8/3+HxkQggBI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HNzc3Hy5Ek8ePAANjY2cHBw0F0uPH36dGzdulV3Uvv+/fs4evRore8bFxeHkpISXL9+\nHfv27UNoaCgAIDQ0FFu2bEFeXh7y8vIQFxeH8PBwAMBXX32FlJQUAICDgwMUCgVsbKr+7tamTRuk\npaXVehI7LCwMhw8fRkJCgkEITpkyBf/6179w6dIlXX++/vprFBcX1/p5KhUVFcHGxgYuLi4oKytD\nbGwsioqKaqzNw8MD/v7+WLduHQoLCyGEQGpqaq33zFDzwZEJNVq//+03Ojoab775JtasWYP+/ftj\n7NixUKlUVfbXarXYsWMHli5dCplMBl9fX0RHRwMAgoKCUFxcjFdeeQUZGRlwcnLCH/7wh2oPl1Ua\nMGAARo0aBSEEZs2ahcGDBwMAXn75ZRQVFWH8+PG6EcScOXMAALdv38bq1auRn5+P1q1b49lnn0W/\nfv2qfK6QkBAcPHgQAwcORLt27bBv374qn7tnz55wcHBATk4Ohg4dqtveo0cPrFmzBqtXr0ZKSgrs\n7OzQt29f9O/fX1I/K69QCw4OhoODA2bMmGFwGKy62tavX4+33noLoaGhKC4uRvv27TFr1qwae0fN\nB29aJKqBtd4ISWQJ/BdCVAv+rkUkDcOEqBY80UwkDQ9zERGR0TgyISIiozFMiIjIaAwTIiIyGsOE\niIiMxjAhIiKjMUyIiMho/w/TWJJiO+X3vQAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x7fa562055990>"
      ]
     },
     "metadata": {
      "tags": []
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "from sklearn.metrics import roc_curve\n",
    "from matplotlib import pyplot as plt\n",
    "\n",
    "fpr, tpr, _ = roc_curve(y_eval, probs)\n",
    "plt.plot(fpr, tpr)\n",
    "plt.title('ROC curve')\n",
    "plt.xlabel('false positive rate')\n",
    "plt.ylabel('true positive rate')\n",
    "plt.xlim(0,)\n",
    "plt.ylim(0,);"
   ]
  }
 ],
 "metadata": {
  "colab": {
   "collapsed_sections": [],
   "name": "boosted_trees.ipynb",
   "toc_visible": true,
   "version": "0.3.2"
  },
  "kernelspec": {
   "display_name": "Python 3",
   "name": "python3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
